<template>
  <div>
    <div>axios的深入使用</div>
  </div>
</template>
<script setup>
import axios from "axios";
// axios({
//   url: "http://study.zmyfrank.com/menuList",
//   method: "get",
//   params: { id: 1 },
//   timeout: 5000,
// });
// axios({
//   url: "http://study.zmyfrank.com/createMenu",
//   method: "post",
//   data: { id: 1, name: "宫保鸡丁" },
//   timeout: 5000,
// });
const axiosInstance = axios.create({
  baseURL: "http://study.zmyfrank.com",
  timeout: 5000,
  headers: { Authorization: "fsdfdsfsd" },
});

axiosInstance({
  url: "/menuList",
  method: "get",
});
axiosInstance({
  url: "/createMenu",
  method: "post",
});
</script>
<style></style>
